HDFS-16724. RBF should support get the information about ancestor mount points#4719
HDFS-16724. RBF should support get the information about ancestor mount points#4719goiri merged 3 commits intoapache:trunkfrom
Conversation
|
🎊 +1 overall
This message was automatically generated. |
| import java.io.IOException; | ||
|
|
||
| /** | ||
| * Exception when no location found. |
There was a problem hiding this comment.
Is there a better name that reflects this is from the mount point perspective?
Extend the javadoc a little anyway.
| Map<String, Long> dates = getMountPointDates(src); | ||
| long date = 0; | ||
| if (dates != null && dates.containsKey(src)) { | ||
| if (dates.containsKey(src)) { |
There was a problem hiding this comment.
I would leave the null check; it is good practice.
There was a problem hiding this comment.
Modified it since getMountPointDates always return a not null response. I will roll back this modification.
...-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/RouterClientProtocol.java
Show resolved
Hide resolved
| this.subclusterResolver.getDestinationForPath(path); | ||
| if (location == null) { | ||
| throw new IOException("Cannot find locations for " + path + " in " + | ||
| throw new NoLocationException("Cannot find locations for " + path + " in " + |
There was a problem hiding this comment.
As we have a dedicated exception, we can pass the path and class parameters and build the message in NoLocationException
| public void clearMountTable() throws IOException { | ||
| RouterClient client = routerContext.getAdminClient(); | ||
| MountTableManager mountTableManager = client.getMountTableManager(); | ||
| GetMountTableEntriesRequest req1 = |
| MountTableManager mountTableManager = client.getMountTableManager(); | ||
| AddMountTableEntryRequest addRequest = | ||
| AddMountTableEntryRequest.newInstance(entry); | ||
| AddMountTableEntryResponse addResponse = |
| try { | ||
| routerProtocol.getFileInfo("/testdir2"); | ||
| fail(); | ||
| } catch (IOException ioe) { |
...-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/RouterClientProtocol.java
Show resolved
Hide resolved
|
🎊 +1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
|
@goiri Master, ping. Thanks |
|
@goiri Master, can help me merge this patch into trunk? Then I will rebase HDFS-16728 and HDFS-16734 on the latest trunk. |
Description of PR
Suppose RBF cluster have 2 nameservices and to mount point as below:
Suppose we disable default nameservice of the RBF cluster. If we try to get the file information of the path /user, RBF will throw one IOException to client due to can not find locations for path /user.
But as this case, RBF should should return one valid response to client, because /user has two sub mount point ns1 and ns2.